package admin

import (
	"object/go_cms/models"
	"os"
)

type IndexAdminController struct {
	BaseAdminController
	models.AdminModels
}

// 后台主页
// @router /admin/index [get]
func (c *IndexAdminController) IndexUI() {
	aid := c.GetSession("aid")
	if aid != nil {
		admin, _ := c.GetAdmin(aid.(int64))
		c.Data["user_name"] = admin.User_name
		c.Data["head"] = admin.Head
	} else {
		c.Data["user_name"] = ""
		c.Data["head"] = ""
	}
	c.TplAdmin("index")
}

// @router /admin/welcome [get]
func (c *IndexAdminController) Welcome() {
	c.Data["Sys"] = os.Environ()
	c.TplAdmin("welcome")
}
